using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Support : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            lblNicks.Text = GetNicks();
        }
    }
    private string GetNicks()
    {
        if ( HttpContext.Current.Cache["YHNick"]!=null)
            return (string)HttpContext.Current.Cache["YHNick"];
        else
        {
            string str="";

            string temp="<a href='ymsgr:sendIM?{0}'><img src='http://opi.yahoo.com/online?u={0}&m=g&t=2&l=us' alt =''/></a><br><br>";

            string sNick = System.Configuration.ConfigurationManager.AppSettings["YHNicks"];

            if( ! string.IsNullOrEmpty(sNick) )
            {   

                string[] nickArray = sNick.Split(new string[]{";"},StringSplitOptions.RemoveEmptyEntries);
                foreach( string s in nickArray)
                {
                    str+=temp.Replace("{0}",s);
                }
                
            }
            HttpContext.Current.Cache.Insert("YHNick",str);
            return str;
        }
    }



    
}
